/*
	Programação Concorrente
	Trabalho 3
	Turma A

	Adilson Abreu Couto Rapozo Junior ( n. USP: 6402336 )
	Luiz Alfredo Bertoni ( n. USP: 6418834 )
	Rodrigo Fernandes da Costa ( n. USP: 6793073 )
*/

#ifndef _MAIN_H_
#define _MAIN_H_

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <mpi.h>
#include <omp.h>

/* struct to help managing all factors*/
typedef struct {
    double ** matrix;
    int J_ORDER;
    int J_ROW_TEST;
    double J_ERROR;
    int J_ITE_MAX;
} strut;

/*copy the matrix to be solved*/
strut * loadStrut(char *);

/*allocate space for all data*/
strut * allocStrut(int);

/*print system*/
void printSystem(strut *);

/*prints matrix*/
void printMatrix(strut *);

/*deallocate memory*/
void cleansys(strut *);

double jacobirError(double *, double *, int);

void jacobi(strut *, double *, double *, int, int);

#endif
